/**
 * Copyright Denalta, LLC. 2010. All rights reserved.
 *
 * This file is part of ToniteAlive
 *
 * ToniteAlive is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ToniteAlive is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.denalta.tonitealive.tests;

import static org.junit.Assert.assertEquals;

import java.util.Collection;
import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.denalta.tonitealive.Event;
import com.denalta.tonitealive.User;

public class EventTest {

	private Event event;
	
	@Before
	public void setUp() throws Exception {
		event = new Event();
	}

	@After
	public void tearDown() throws Exception {
	}
	
	@Test
	public void testStartDateAccessors() {
		Date startDate = new Date();
		event.setStartDate(startDate);
		assertEquals("Start date test.", startDate, event.getStartDate());
	}
	
	@Test
	public void testEndDateAccessors() {
		Date endDate = new Date();
		event.setEndDate(endDate);
		assertEquals("End date test", endDate, event.getEndDate());
	}
	
	@Test
	public void testNameAccessors() {
		String name = "Test";
		event.setName(name);
		assertEquals("Name accessor", name, event.getName());
	}
	
	@Test
	public void testDescriptionAccessors() {
		String description = "Testing testing testing testing";
		event.setDescription(description);
		assertEquals("Description accessor", description, event.getDescription());
	}
	
	@Test
	public void testAccessAttendees() {
		User user =  new User();
		event.addAttendee(user);
		Collection<String> attendees = event.getAttendees();
		assertEquals("Attendees count.", 1, attendees.size());
	}

}
